package com.ibm.cps.spark.streaming.adapter;

import java.util.Map;

import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.IOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichSpout;

import com.ibm.cps.message.AbstractMessage;

/**
 * Created by telekinesis on 4/27/15.
 */
public abstract class AbstractSparkEmbeddedSpout extends BaseRichSpout {
    protected IOutputCollector collector;

    public AbstractSparkEmbeddedSpout(IOutputCollector collector) {
        this.collector = collector;
    }

    @Override
    public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) {}

    @Override
    public void nextTuple() {}

    public abstract void emitNewData(String streamName, final AbstractMessage data);

    @Override
    public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {}
}
